//CountedQ.cpp
/********************************************************************************
*																				*
*	Author:			Vanessa Starkey												*
*	Assignment:		Assignment 8												*
*	Class:			CPS-151														*
*	Instructor:		V. Starkley													*
*	Due Date:		November 7													*
*																				*
*	This file delcares the counted queue class.									*
*																				*
********************************************************************************/


template<class ItemType>
CountedQue<ItemType>::CountedQue() : QueType<ItemType>()
{
    length = 0;
}

template<class ItemType>
bool CountedQue<ItemType>::Enqueue(ItemType newItem)
{
  
   if( QueType<ItemType>::Enqueue(newItem))
   {
	   length++;
	   return true;
   }
   else
	   return false;
}

template<class ItemType>
bool CountedQue<ItemType>::Dequeue(ItemType& item)
{
    
    if( QueType<ItemType>::Dequeue(item))
	{
		length--;
		return true;
	}
	else
		return false;
}

template<class ItemType>
int CountedQue<ItemType>::LengthIs() const
{
    return length;
}

template<class ItemType>
void CountedQue<ItemType>::MakeEmpty()
{
	length = 0;
	QueType<ItemType>::MakeEmpty();
}


